package com.yanqu.road.entity.activity.hsisland.enums;

import com.yanqu.road.entity.activity.sonhai.enums.SonHaiPlotTypeEnum;

public enum HsIslandLatticeTypeEnum {
    LATTICE_TYPE_SCENE(0, "场景，不可通行", false, false, false),
    LATTICE_TYPE_BOX(1, "宝箱", true, false, true),
    LATTICE_TYPE_FOUR(2, "4格事件", true, false, true),
    LATTICE_TYPE_ONE(3, "1格事件", true, false, true),
    LATTICE_TYPE_BORN(4, "起始点", true, true, false),
    ;

    /**
     * 类型
     */
    private int type;

    /**
     * 名称
     */
    private String name;

    /**
     * 是否可停留在该地块上
     */
    private boolean canStay;

    /**
     * 是否没有事件处理完结就可以停留
     */
    private boolean canStayNotEvent;

    /**
     * 是否可探索
     */
    private boolean canExplore;

    HsIslandLatticeTypeEnum(int type, String name, boolean canStay, boolean canStayNotEvent, boolean canExplore) {
        this.type = type;
        this.name = name;
        this.canStay = canStay;
        this.canStayNotEvent = canStayNotEvent;
        this.canExplore = canExplore;
    }

    public int getType() {
        return type;
    }

    public String getName() {
        return name;
    }

    /**
     * 判断是否可停留
     * @param type
     * @return
     */
    public static boolean checkCanStay(int type) {
        for (HsIslandLatticeTypeEnum value : HsIslandLatticeTypeEnum.values()) {
            if (value.getType() == type) {
                return value.canStay;
            }
        }
        return false;
    }

    /**
     * 判断是否不用事件完结就可以停留
     * @param type
     * @return
     */
    public static boolean checkCanStayNotEvent(int type) {
        for (HsIslandLatticeTypeEnum value : HsIslandLatticeTypeEnum.values()) {
            if (value.getType() == type) {
                return value.canStayNotEvent;
            }
        }
        return false;
    }

    /**
     * 是否可探索
     * @param type
     * @return
     */
    public static boolean checkCanExplore(int type) {
        for (HsIslandLatticeTypeEnum value : HsIslandLatticeTypeEnum.values()) {
            if (value.getType() == type) {
                return value.canExplore;
            }
        }
        return false;
    }
}
